﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            const double PI = 3.14;
            double r = 4;
            double area = PI * r * r;
            Console.WriteLine("圆形的面积是:" + area);

            //输入身份证18位，18岁以上，提示“欢迎光临”
            //身份证：341021200011135275
            Console.WriteLine("请输入身份证号:");
            string card = Console.ReadLine();
            int num = int.Parse(card.Substring(6, 4));
            int age = DateTime.Now.Year - num;
            if (age >= 18)
            {
                Console.WriteLine("欢迎光临！！！");
            }
            else
            {
                Console.WriteLine("好好读书，未成年人不得入内！！！");
            }

            //输入学生成绩：0-29重修  30-59 补考 60- 79良好 80-100优秀
            Console.WriteLine("请输入学生成绩:");
            int score = int.Parse(Console.ReadLine());
            if (score >= 80)
            {
                Console.WriteLine("优秀");

            }
            else if (score >= 60)
            {
                Console.WriteLine("良好");
            }
            else if (score >= 30)
            {
                Console.WriteLine("补考");
            }
            else
            {
                Console.WriteLine("重修");
            }

            //输入学生成绩：0-29重修  30-59 补考 60- 79良好 80-100优秀 使用switch...case 
            Console.WriteLine("请输入学生成绩:");
            int Ksc = int.Parse(Console.ReadLine());
            switch (Ksc / 10)
            {
                case 0:
                case 1:
                case 2:
                    Console.WriteLine("重修"); break;
                case 3:
                case 4:
                case 5:
                    Console.WriteLine("补考"); break;
                case 6:
                case 7:
                    Console.WriteLine("良好"); break;
                case 8:
                case 9:
                case 10:
                    Console.WriteLine("优秀"); break;

                default:
                    Console.WriteLine("输入错误！！！");
                    break;



            }
        }
    }
}
